Fastening elements of the type in question here are known. They serve to fix an attachment element on the extension piece of a syringe or carpule or the like, which attachment element can be a needle, a connection element for an injection device or the like. Fastening elements of this type have an annular main body which is provided, for example, with an internal thread into which an external thread of a needle, of a connection element or the like can engage in order to fix an attachment element of this type on a syringe or carpule. The annular main body is provided with a ring element which is mounted pivotably on the main body and which is designed such that it engages around the extension piece of the syringe or carpule in the mounted state of the fastening element and ensures that the fastening element is securely fixed on the extension piece. It has been found that the retaining forces of the fastening element are in some cases inadequate, with the result that the attachment element inadvertently comes loose even during transport of the syringe or carpule, in particular however during the handling of the syringe or carpule, such that the content of the syringe or carpule may be contaminated, which can lead to the loss of very valuable medicaments or may also damage a patient's health.